package com.sinosoft.user.api;

import com.alibaba.fastjson.JSONObject;
import com.sinosoft.common.core.constant.ServiceNameConstants;
import com.sinosoft.common.core.domain.R;
import com.sinosoft.system.api.model.LoginUser;
import com.sinosoft.user.api.factory.RemoteFlowFallbackFactory;
import org.apache.poi.ss.formula.functions.T;
import org.flowable.task.api.Task;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * 用户服务
 *
 * @author tangyongbo
 */
@FeignClient(contextId = "remoteFlowService", value = "bmps-modules-flow", fallbackFactory = RemoteFlowFallbackFactory.class)
public interface RemoteFlowService
{
    /**
     * 通过用户名查询用户信息
     *
     * @param modelId 模型ID
     * @param businessKey 业务主键
     * @return 结果
     */
    @PutMapping(value = "/api/process-model/start")
    public String startProcess(@RequestParam("modelId")  String modelId, @RequestParam("businessKey") String businessKey);


    @GetMapping(value = "/api/process-model/getTasks")
    public JSONObject getTasks(@RequestParam("userKey") String userKey);


    @RequestMapping(value = "/api/process-model/flowDiagram",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public feign.Response flowDiagram(@RequestParam("businessKey") String businessKey);


    @RequestMapping(value = "/api/process-model/completeTask")
    public String completeTask(@RequestParam("taskId") String taskId);
}
